package cn.com.nou.common.entity;

import java.util.List;

import javax.validation.constraints.Min;

/**
 * 分页
 * 
 * @author lixuefeng
 */
public class Pagination {

	public Pagination() {

	}

	public Pagination(List<?> resultList, int totalCount) {
		this.resultList = resultList;
		this.total = totalCount;
	}

	private int total;
	private List<?> resultList;

	@Min(value = 0, message = "页码必须大于0")
	private int pageNo;
	//@Max(value = 40, message = "每页大小不能超过50条")
	private int pageSize;

	private int offset;
	private int limit;

	public Pagination(int offset, int limit) {
		this.offset = offset;
		this.limit = limit;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getOffset() {
		return offset;
	}

	public void setOffset(int offet) {
		this.offset = offet;
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public List<?> getResultList() {
		return resultList;
	}

	public void setResultList(List<?> resultList) {
		this.resultList = resultList;
	}
}
